package com.kun.flutter_app.qrcode

import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.PluginRegistry

/**
 * @author: liangkun
 * @date: 2021-04-27 16:24
 * @description:条形码生成
 */
class QrPlugin : FlutterPlugin {
    override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
        val messenger: BinaryMessenger = binding.binaryMessenger
//        binding
//                .platformViewRegistry
//                .registerViewFactory(
//                        "plugins.flutter.io/qr_code", QrcodeFactory(messenger))
    }

    companion object {
        @JvmStatic
        fun registerWith(registrar: PluginRegistry.Registrar) {
//            registrar
//                    .platformViewRegistry()
//                    .registerViewFactory(
//                            "plugins.flutter.io/qr_code",
//                            QrcodeFactory(registrar.messenger()))
        }
    }

    override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {

    }
}